Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] ContentTypeBuilder LTS #1333

Merged
merged 1 commit into from
Feb 24, 2017

Conversation

monosize
Copy link
Member

move showItem configuration into ext_localconf.php - using CompatibilityRegistry
convert arrays in ext_localconf.php into short arrays

@monosize
Copy link
Member Author

@NamelessCoder What I just think: can we put the call to CompatibilityRegistry for the DEFAULT_SHOWITEM into an if condition with TYPO3_MODE === 'BE' ?

@monosize
Copy link
Member Author

I have made an update which now checks for TYPO3_MODE === 'BE'

@monosize
Copy link
Member Author

Please wait: I'll better remove the TCA data from ext_localconf.php to reduce the memory consumption. It's better to use a compatibility class for the TCA data with CompatibilityRegistry.

@monosize
Copy link
Member Author

@NamelessCoder maybe we can combine the same TCA configuration in a separate class and can use it for fluidcontent and flux. It's redundant data.
What do you think?
see FluidTYPO3/fluidcontent#387

@monosize
Copy link
Member Author

I changed to a public static property for $defaultShowItem so we can use it also in fluidcontent for TCA in Configuration/TCA/Overrides/tt_content.php

@monosize
Copy link
Member Author

Or should we use \FluidTYPO3\Flux\Helper\ContentTypeBuilder::addBoilerplateTableConfiguration to create the TCA in fluidcontent?
see also FluidTYPO3/fluidcontent#388

@NamelessCoder
Copy link
Member

If possible use addBoilerplateTableConfiguration - also if that means we nedd to add an argument for example.

@monosize monosize force-pushed the contentTypeBuilder branch 5 times, most recently from 16c1f81 to ad751bc Compare February 17, 2017 20:26
@monosize
Copy link
Member Author

@NamelessCoder Hi Claus.
the PR is now ready, but take a look at this
https://github.com/FluidTYPO3/flux/blob/development/Classes/Helper/ContentTypeBuilder.php#L204

$GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['ds']['*,' . $contentType] = [];

had no effect all the time, because it should be

$GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds']['*,' . $contentType] = [];

but then the empty array is wrong

I have removed it and now $GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds']['default'] is used for default dataStructure.

'default' => '
	<T3DataStructure>
	  <ROOT>
		<type>array</type>
		<el>
			<!-- Repeat an element like "xmlTitle" beneath for as many elements you like. Remember to name them uniquely  -->
		  <xmlTitle>
			<TCEforms>
				<label>The Title:</label>
				<config>
					<type>input</type>
					<size>48</size>
				</config>
			</TCEforms>
		  </xmlTitle>
		</el>
	  </ROOT>
	</T3DataStructure>
'

@NamelessCoder
Copy link
Member

You can skip the new class with static properties containing TCA (generally speaking, this pattern is not desired; metadata should not be configured in a class). Instead, use the CompatibilityRegistry in the TCA override file for tt_content and apply the TCA there as well. The result then gets cached which is fine in this case (better than not caching, really).

@monosize
Copy link
Member Author

Now the CompatibilityRegistry is used in TCA override file for tt_content.

Using CompatibilityRegistry in ext_localconf for defaultShowItem for TCA generation.
@NamelessCoder NamelessCoder merged commit 0abf5e3 into FluidTYPO3:development Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants